package org.martyn.danbodroid.preferences;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.preference.PreferenceManager;

public class Preferences
{
	// Alle basis keys voor de preferences
	public static final String LOGGER_TAG = "Danbooru";
	public static final boolean LOGGER_ISENABLED = true;

	public static final String DATABASE_NAME = "danboDroid.db";
	public static final int DATABASE_VERSION = 1;

	public static final String KEY_PREF_POST_PER_PAGE = "danbodroid_post_per_page";
	public static final String KEY_PREF_RATING = "danbodroid_rating";

	public static final String KEY_PREF_FIRST_START = "danbodroid_first_start";
	public static final String KEY_PREF_SELECTED_SERVER = "danbodroid_selected_server";
	
	
	public static void storeSelectedServerSettings(Context context, int serverId)
	{
		SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
		
		Editor editor = prefs.edit();
		editor.putInt(KEY_PREF_SELECTED_SERVER, serverId);
		editor.commit();
	}
	
	public static int loadSelectedServerSettings(Context context)
	{
		SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);

		return prefs.getInt(KEY_PREF_SELECTED_SERVER, -1);
	}
	
}
